package com.ccit.money.api;

import com.ccit.common.exception.GymException;
import com.ccit.common.result.Result;
import com.ccit.common.utils.RedisUtils;
import com.ccit.model.Money;
import com.ccit.model.vo.money.MoneyVo;
import com.ccit.money.service.MoneyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "资金调用接口")
@RestController
@RequestMapping("/money/api")
public class MoneyApiController {
    @Autowired
    private MoneyService moneyService;

    @Autowired
    private RedisUtils redisUtils;

   /* @ApiOperation(value = "保存资金")
    @PostMapping("/saveMoney")
    public boolean saveMoney(@RequestBody MoneyVo moneyVo) {
        Money money = new Money();
        money.setMoneyType(moneyVo.getMoneyType());
        money.setTypeName(moneyVo.getTypeName());
        money.setAmout(moneyVo.getAmout());
        boolean result = moneyService.save(money);
        if (result) {
            redisUtils.deleteRedisKeys("AllMoney");
            redisUtils.deleteRedisKeys("MoneyPage");
            redisUtils.deleteRedisKeys("AllSimMoney");
            redisUtils.deleteRedisKeys("MonthMoney");
            redisUtils.deleteRedisKeys("ToMoney");
            return true;
        } else
            return false;
    }*/
}
